package com.ruoyi.supervise.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.supervise.config.CityConfig;
import com.ruoyi.supervise.domain.MyTest;
import com.ruoyi.supervise.domain.decisupport.City;
import com.ruoyi.supervise.mapper.MyTestMapper;
import com.ruoyi.supervise.service.IMyTestService;


/**
 * @ClassName: MyTestServiceImpl
 * @Description: 测试从数据源
 * @Author wtj
 * @DateTime 2020年3月9日 上午10:41:31
 */
@Service
@DataSource(value = DataSourceType.SLAVE)
public class MyTestServiceImpl implements IMyTestService 
{
    @Autowired
    private MyTestMapper MyTestMapper;
    
    @Autowired
    private CityConfig cityConfig;

	@Override
	public List<MyTest> selectMyTest() {
		for(City c:cityConfig.getCityList())
		{
			System.out.println(c);
		}
		return MyTestMapper.selectMyTest();
	}

	@Override
	public List<MyTest> selectMyTestTwo(Integer num) {
		// TODO Auto-generated method stub
		return MyTestMapper.selectMyTestTwo(num);
	}

   
}
